﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using Jarvis.Server.Domain;
using NUnit.Framework;

namespace Jarvis.Server.Test.ActionsTests
{
    [TestFixture]
    public class ShowMessageActionTest
    {
        [Test]
        public void ShouldDisplayMessage()
        {
            var action = new ShowMessageAction() {Message = "Messaggio"};

            Assert.DoesNotThrow(action.Execute);

            Thread.Sleep(200);

            var processes = Process.GetProcessesByName("Jarvis.Server.MessageDisplayer");
            Assert.That(processes.Any());

            foreach (var process in processes)
            {
                process.Kill();
            }

        }
    }
}
